#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
@author: zhangZW
@file: tools.py
@time: 2023/01/19
@des: 各种方法
"""
import configparser
import os.path
# from pathlib import Path
import base64
from sys import platform


def readini():
    config = configparser.ConfigParser()
    file_dir = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'config.ini')
    config.read(file_dir, encoding='UTF-8')
    return config


def analyse_b64(value: str):
    return base64.b64decode(value).decode()


def get_system():
    if ("linux" == platform) or ("linux2" == platform):
        return "Linux"
    elif "win32" == platform:
        return "Windows"
    else:
        return "Others"


if __name__ == '__main__':
    # print(readini().getint('client', 'port'))
    # print(analyse_b64('MTI3LjAuMC4xLDQ0NDQ='))
    print(get_system())
